/* 主题配置文件 */

/* 默认浅色主题 */
:root,
[data-theme="light"] {
  /* 主色调 - 深蓝色主题 */
  --color-primary: #1e40af;
  --color-primary-light: #3b82f6;
  --color-primary-dark: #1e3a8a;
  --color-primary-rgb: 30, 64, 175;
  --color-primary-alpha: rgba(30, 64, 175, 0.1);

  /* 背景色 */
  --color-background: #ffffff;
  --color-surface: #f8fafc;
  --color-surface-elevated: #ffffff;
  --color-hover: #f1f5f9;
  --color-active: #e2e8f0;

  /* 文本色 */
  --color-text: #1f2937;
  --color-text-secondary: #6b7280;
  --color-text-muted: #9ca3af;
  --color-text-inverse: #ffffff;

  /* 边框色 */
  --color-border: #e5e7eb;
  --color-border-light: #f3f4f6;
  --color-border-dark: #d1d5db;

  /* 状态色 */
  --color-success: #10b981;
  --color-success-light: #34d399;
  --color-success-dark: #059669;
  --color-success-rgb: 16, 185, 129;

  --color-warning: #f59e0b;
  --color-warning-light: #fbbf24;
  --color-warning-dark: #d97706;
  --color-warning-rgb: 245, 158, 11;

  --color-error: #ef4444;
  --color-error-light: #f87171;
  --color-error-dark: #dc2626;
  --color-error-rgb: 239, 68, 68;

  --color-info: #3b82f6;
  --color-info-light: #60a5fa;
  --color-info-dark: #2563eb;
  --color-info-rgb: 59, 130, 246;

  /* 聊天特定颜色 */
  --color-chat-bubble-own: var(--color-primary);
  --color-chat-bubble-other: var(--color-surface);
  --color-chat-bubble-system: #f3f4f6;
  --color-online: var(--color-success);
  --color-away: var(--color-warning);
  --color-offline: var(--color-text-muted);
}

/* 深色主题 */
[data-theme="dark"] {
  /* 主色调保持不变，但调整透明度 */
  --color-primary: #3b82f6;
  --color-primary-light: #60a5fa;
  --color-primary-dark: #2563eb;
  --color-primary-alpha: rgba(59, 130, 246, 0.1);

  /* 背景色 */
  --color-background: #0f172a;
  --color-surface: #1e293b;
  --color-surface-elevated: #334155;
  --color-hover: #334155;
  --color-active: #475569;

  /* 文本色 */
  --color-text: #f8fafc;
  --color-text-secondary: #cbd5e1;
  --color-text-muted: #94a3b8;
  --color-text-inverse: #0f172a;

  /* 边框色 */
  --color-border: #334155;
  --color-border-light: #475569;
  --color-border-dark: #1e293b;

  /* 聊天特定颜色 */
  --color-chat-bubble-other: #334155;
  --color-chat-bubble-system: #475569;
}

/* 高对比度主题 */
[data-theme="high-contrast"] {
  --color-primary: #0000ff;
  --color-primary-light: #4040ff;
  --color-primary-dark: #0000cc;

  --color-background: #ffffff;
  --color-surface: #ffffff;
  --color-surface-elevated: #ffffff;
  --color-hover: #f0f0f0;
  --color-active: #e0e0e0;

  --color-text: #000000;
  --color-text-secondary: #000000;
  --color-text-muted: #333333;
  --color-text-inverse: #ffffff;

  --color-border: #000000;
  --color-border-light: #333333;
  --color-border-dark: #000000;

  --color-success: #008000;
  --color-warning: #ff8000;
  --color-error: #ff0000;
  --color-info: #0000ff;
}

/* 蓝色主题变体 */
[data-theme="blue"] {
  --color-primary: #0ea5e9;
  --color-primary-light: #38bdf8;
  --color-primary-dark: #0284c7;
  --color-chat-bubble-own: var(--color-primary);
}

/* 绿色主题变体 */
[data-theme="green"] {
  --color-primary: #10b981;
  --color-primary-light: #34d399;
  --color-primary-dark: #059669;
  --color-chat-bubble-own: var(--color-primary);
}

/* 紫色主题变体 */
[data-theme="purple"] {
  --color-primary: #8b5cf6;
  --color-primary-light: #a78bfa;
  --color-primary-dark: #7c3aed;
  --color-chat-bubble-own: var(--color-primary);
}

/* 橙色主题变体 */
[data-theme="orange"] {
  --color-primary: #f97316;
  --color-primary-light: #fb923c;
  --color-primary-dark: #ea580c;
  --color-chat-bubble-own: var(--color-primary);
}

/* 密度设置 */
[data-density="compact"] {
  --spacing-1: 0.125rem;
  --spacing-2: 0.25rem;
  --spacing-3: 0.5rem;
  --spacing-4: 0.75rem;
  --spacing-5: 1rem;
  --spacing-6: 1.25rem;
  --spacing-8: 1.5rem;
  
  --font-size-xs: 0.6875rem;
  --font-size-sm: 0.8125rem;
  --font-size-base: 0.9375rem;
  
  --titlebar-height: 48px;
  --sidebar-width: 240px;
  --client-info-width: 260px;
  --tabs-width: 260px;
}

[data-density="comfortable"] {
  --spacing-1: 0.375rem;
  --spacing-2: 0.75rem;
  --spacing-3: 1rem;
  --spacing-4: 1.25rem;
  --spacing-5: 1.5rem;
  --spacing-6: 1.75rem;
  --spacing-8: 2.25rem;
  
  --font-size-xs: 0.8125rem;
  --font-size-sm: 0.9375rem;
  --font-size-base: 1.0625rem;
  
  --titlebar-height: 72px;
  --sidebar-width: 320px;
  --client-info-width: 340px;
  --tabs-width: 340px;
}

/* 动画偏好设置 */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: none;
    --transition-normal: none;
    --transition-slow: none;
  }
}

/* 系统主题偏好 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    /* 如果用户没有明确设置主题，使用系统偏好 */
    --color-background: #0f172a;
    --color-surface: #1e293b;
    --color-surface-elevated: #334155;
    --color-hover: #334155;
    --color-active: #475569;

    --color-text: #f8fafc;
    --color-text-secondary: #cbd5e1;
    --color-text-muted: #94a3b8;
    --color-text-inverse: #0f172a;

    --color-border: #334155;
    --color-border-light: #475569;
    --color-border-dark: #1e293b;

    --color-chat-bubble-other: #334155;
    --color-chat-bubble-system: #475569;
  }
}

/* 高对比度偏好 */
@media (prefers-contrast: high) {
  :root:not([data-theme]) {
    --color-border: #000000;
    --color-text-secondary: #000000;
  }
}